from django.urls import path, re_path

from .views.lablog import (
    CreateLabLogView,
    UpdateLabLogView,
    LabLogMonthArchiveView,
    LabLogDetailView,
    ajax_server_now
)

from .views.shiftschedule import (
    bulk_create_schedule_by_month,
    update_schedule,
    ScheduleMonthArchiveView,
    sign_in,
    change_sign_in
)

from .views.stationdatalog import (
    station_datalog_list_by_day,
    StationDataLogDayArchiveView,
    add_station_datalog,
    update_station_datalog
)

urlpatterns = [
    path('lablog/<int:year>/<int:month>/<int:day>/<int:slot>/create/', CreateLabLogView.as_view(),
         name='create_lablog'),
    path('lablog/<int:year>/<int:month>/<int:day>/<int:slot>/update/', UpdateLabLogView.as_view(),
         name='update_lablog'),
    path('lablog/<int:year>/<int:month>/', LabLogMonthArchiveView.as_view(), name='lablog_by_month'),
    path('lablog/detail/<int:pk>/', LabLogDetailView.as_view(), name='lablog_detail'),
    path('schedule/<int:year>/<int:month>/bulk/create/', bulk_create_schedule_by_month,
         name='bulk_create_schedule_by_month'),
    path('schedule/<int:pk>/update/', update_schedule, name='update_schedule'),
    # path('schedule/<int:year>/<int:month>/update/', bulk_update_schedule_by_month, name='update_schedule'),
    # path('schedule/<int:year>/<int:month>/list/', schedule_list_by_month, name='schedule_list'),
    path('schedule/<int:year>/<int:month>/', ScheduleMonthArchiveView.as_view(),
         name='schedule_by_month'),
    path('schedule/<int:pk>/<int:mode>/signin/', sign_in, name='sign_in'),
    path('schedule/<int:pk>/<int:mode>/signin/change/', change_sign_in, name='change_sign_in'),
    # path('station/datalog/<int:year>/<int:month>/<int:day>/list/', station_datalog_list_by_day,
    #      name='stations_datalog_by_day'),
    path('station/datalog/<int:year>/<int:month>/<int:day>/', StationDataLogDayArchiveView.as_view(),
         name='station_datalog_by_day'),
    path('station/datalog/<int:station_pk>/<int:year>/<int:month>/<int:day>/<int:is_auto>/add/', add_station_datalog,
         name='add_station_datalog'),
    path('station/datalog/<int:pk>/<int:is_auto>/update/', update_station_datalog, name='update_station_datalog'),
    path('ajax/server_now/', ajax_server_now, name='ajax_server_now')
]
